package com.fang.stream_export_date.handler;

import com.fang.stream_export_date.entity.Authors;
import com.fang.stream_export_date.entity.DO.TestExport;
import com.fang.stream_export_date.utils.DownloadProcessor;
import org.apache.ibatis.session.ResultContext;
import org.apache.ibatis.session.ResultHandler;

/**
 * @Description
 * @Author Bernie_fang
 * @Date 2023/10/18 23:18
 **/
public class CustomResultHandler implements ResultHandler {

    private final DownloadProcessor downloadProcessor;

    public CustomResultHandler( DownloadProcessor downloadProcessor) {
        super();
        this.downloadProcessor = downloadProcessor;
    }

    public void handleResult(ResultContext resultContext) {
        TestExport authors = (TestExport) resultContext.getResultObject();
        downloadProcessor.processData(authors);
    }


}